<template>
  <div>
    <van-nav-bar title="查看认证信息" left-arrow @click-left="onClickLeft"></van-nav-bar>
    <div class="yhk">
      <div>姓名：张寒路</div>
      <div style="font-size: 16px">身份证号:110110110110110110</div>
    </div>
  </div>
</template>
<script setup lang="ts">
import { findUserIdCard } from '../../api/search'
import JSEncrypt from 'jsencrypt'
import { ref } from 'vue'

const onClickLeft = () => {
  history.back()
}
const decryptCrypt = new JSEncrypt()
const userId = ref(parseInt(localStorage.getItem('userId') as string))
const sessionId = ref(JSON.parse(localStorage.getItem('sessionId') as string))
const findUserIdCard1 = async () => {
  const res = await findUserIdCard(userId.value, sessionId.value)
  console.log(res.data.result)
  const privateKey = '没有私钥'

  // 设置私钥
  decryptCrypt.setPrivateKey(privateKey)

  // 解密

  console.log('1111', decryptCrypt.decrypt(res.data.result.name))
}
findUserIdCard1()
</script>
<style>
.yhk{
  width: 100vw;
  margin: 20px auto;
  height: 250px;
  background: url("../../assets/images/image/hdpi/id_card_bg.png") no-repeat;
  background-size: 100%;
  margin: 20px auto;
  padding: 20px;
  color: #fff;
}
</style>